import { createApp } from 'vue'
import App from './App.vue'
import 'animate.css'
import router from '@/router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/router/permission'
import 'element-plus/theme-chalk/dark/css-vars.css'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { registerStore } from '@/pinia'

const app = createApp(App);
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
app.use(router)
app.use(pinia);
registerStore() // 这里是进行一个注册，不然的话页面上是拿不到值的
app.use(ElementPlus)

// app.directive("scrollBottom", {
//     updated(el) {
//         el.scrollTo({
//             top: el.scrollHeight - el.clientHeight,
//             behavior: "smooth"
//         });
//     }
// })

app.mount('#app')
